-
Notifications
You must be signed in to change notification settings - Fork 475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize lodash. Fixes #6006 #6415
Conversation
✅ Deploy Preview for care-egov-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
cc: @sainak |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Omkar76 wasn't the issue about removing and using custom utility functions instead?
This PR is just replacing with another package and updating the imports and doesn't make a noticeable difference in the final bundle size.
We could achieve a much lower bundle size if we built the utility functions within care right?
cc: @sainak
I believe the size reduction is significant (547 -> 122). We can keep this PR on hold until @sainak has implemented the utilities to replace lodash. If that reduces size significantly more than this we can merge that instead. |
@rithviknishad @sainak can you review this pr once, we'll go ahead with this pr for now and update and keep the original issue open to remove this dependency |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
@nihal467 the changes looks good, just give it a general test of above mentioned files |
tested |
@Omkar76 make the necessary changes suggested by Bodhi |
Hi @bodhish,
|
You could do: <span className="capitalize">
{"COMPLETED".toLowerCase()}
</span>
// 👉 Completed |
WHAT
🤖 Generated by Copilot at 73f49f9
This pull request replaces the
lodash
dependency withlodash-es
and imports only the needed functions from the library in various files. This reduces the bundle size and improves the performance of the frontend application. It also refactors some code to use the imported functions directly and consistently.Proposed Changes
lodash
withlodash-es
._
. Only import needed utilities@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers
HOW
🤖 Generated by Copilot at 73f49f9
lodash
withlodash-es
and import only required functions inpackage.json
and various files to reduce bundle size and support tree-shaking (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)lodash-es
to match the import changes inExternalResultUpload.tsx
,Reports/index.tsx
,Reports/utils.tsx
,ShowInvestigation.tsx
,Table.tsx
,SampleDetails.tsx
,SampleTestCard.tsx
, andNotifications.js
(link, link, link, link, link, link, link, link, link, link, link, link, link)lodash
fromInvestigationTable.tsx
(link)Before optimization
After optimization